// ExtractDialog.h

#ifndef __EXTRACT_DIALOG_H
#define __EXTRACT_DIALOG_H

#include "ExtractDialogRes.h"

#ifndef  NO_REGISTRY
#include "Common/App/AppRegistry.h"
#endif
#include "Common/Archive/ExtractMode.h"

namespace NExtractionDialog
{
  /*
  namespace NFilesMode
  {
    enum EEnum
    {
      kSelected,
      kAll,
      kSpecified
    };
  }
  */
}

class CExtractDialog: public CDialogImpl<CExtractDialog>
{
  #ifdef NO_REGISTRY
  NWindows::NControl::CDialogChildControl _path;
  #else
  CComboBox _path;
  #endif
  
  #ifndef _SFX
  CEdit _passwordControl;
  CComboBox _pathMode;
  CComboBox _overwriteMode;
  #endif

  #ifndef _SFX
  // int GetFilesMode() const;
  void UpdatePasswordControl();
  #endif
  
  void OnButtonSetPath();
    
public:
		enum { IDD = IDD_DIALOG_EXTRACT};

	BEGIN_MSG_MAP(CExtractDialog)
		MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
#ifndef  NO_REGISTRY
		MESSAGE_HANDLER(WM_HELP, OnHelp)
#endif
		COMMAND_ID_HANDLER(IDOK, OnOK)
		COMMAND_ID_HANDLER(IDCANCEL, OnCancel)
		COMMAND_ID_HANDLER(IDC_EXTRACT_BUTTON_SET_PATH, OnButtonSetPath)		
		COMMAND_ID_HANDLER(IDC_EXTRACT_CHECK_SHOW_PASSWORD, UpdatePasswordControl)
	END_MSG_MAP()

	LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);	
	LRESULT OnHelp(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
#ifndef  NO_REGISTRY
	LRESULT OnOK(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
#endif
	LRESULT OnCancel(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
	{
		EndDialog(wID);
		return 0;
	}
	LRESULT OnButtonSetPath(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
	{
		OnButtonSetPath();
		return 0;
	}

	LRESULT UpdatePasswordControl(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
	{
		UpdatePasswordControl();
		return 0;
	}
		
  // bool _enableSelectedFilesButton;
  // bool _enableFilesButton;
  // NExtractionDialog::NFilesMode::EEnum FilesMode;

  CString DirectoryPath;
  #ifndef _SFX
  CString Password;
  #endif
  Common::Archive::Extract::PathMode PathMode;
  Common::Archive::Extract::OverwriteMode OverwriteMode;
    
};

#endif
